#define _CRT_SECURE_NO_WARNINGS 1

#include<stdio.h>

void print_space(int m)
{
	int i = 1;

	for (i = 1; i <= m; i++)
	{
		putchar(32);
	}
}

void print_first_leaf(int m)
{
	int i = 0;

	for (i = 1; i <= m; i++)
	{
		printf("*     ");
	}

	putchar('\n');

}

void print_second_leaf(int m)
{
	int i = 0;

	for(i=1;i<=m;i++)
	{
		printf("* *   ");
	}

	putchar('\n');

}

void print_root(int m)
{
	int k = 3 * m-1;
	int i = 1;

	for (i = 1; i <= m; i++)
	{
		print_space(k);
		printf("*\n");
	}
}

void print_third_leaf(int m)
{
	int i = 0;

	for (i = 1; i <= m; i++)
	{
		printf("* * * ");
	}

	putchar('\n');

}

void print_tree(int n)
{
	int i = 0;
	int k = 0;
	int h = 0;

	h = 3 * n;
	k = 3*n-1;

	for(i=1;i <= h;)
	{
		print_space(k--);
		print_first_leaf((i - 1) / 3 + 1);
		i++;

		print_space(k--);
		print_second_leaf((i - 1) / 3 + 1);
		i++;

		print_space(k--);
		print_third_leaf((i - 1) / 3 + 1);
		i++;
	}

	print_root(n);
}

int main()
{
	int n = 0;

	scanf("%d", &n);

	print_tree(n);
	return 0;
}